﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SdmxMl.Common
{
    public class HierarchyNode
    {
        public string Name { get; set; }
        public int ImageIndex { get; set; }
        public object Tag { get; set; }

        private HierarchyNodeList _nodes;
        public HierarchyNodeList Nodes
        {
            get { return _nodes; }
        }

        public HierarchyNode(string n, int i)
        {
            Name = n;
            ImageIndex = i;
            _nodes = new HierarchyNodeList();
        }


    }

    public class HierarchyNodeList : List<HierarchyNode>
    {
        public HierarchyNodeList()
        {
        }

        public void SortNodes()
        {
            this.Sort(delegate(HierarchyNode p1, HierarchyNode p2)
            { return p1.Name.CompareTo(p2.Name); });
        }
    }
}
